package com.nicky.kids.Utility;

import java.util.Calendar;
import java.util.Date;

public class DateUtil {
    private static final String TAG = "nick_DateUtil";
    private static Calendar calendar = Calendar.getInstance();

    static void getCurrentDate() {
        //date.
    }

    public static int getYear() {
        return calendar.get(Calendar.YEAR);
    }

    public static int getMonth() {
        return calendar.get(Calendar.MONTH) + 1;
    }

    public static int getDay() {
        return calendar.get(Calendar.DAY_OF_MONTH);
    }

    public static int getHour() {
        return calendar.get(Calendar.HOUR_OF_DAY);
    }

    public static int getMinute() {
        return calendar.get(Calendar.MINUTE);
    }

    public static int getSecond() {
        return calendar.get(Calendar.MILLISECOND);
    }

    public static String dateToString() {
        StringBuffer sb = new StringBuffer();
        sb.append(getYear());
        //sb.append("_");
        sb.append(getMonth());
        //sb.append("_");
        sb.append(getDay());
        //sb.append("_");
        sb.append(getHour());
        //sb.append("_");
        sb.append(getMinute());
        //sb.append("_");
        sb.append(getSecond());

        TLog.e(TAG, sb.toString());

        return sb.toString();
    }
}
